;;;; -*- lisp -*-
;;; general stuff
(setq require-final-newline t)
(setq scroll-step 1)
(setq inhibit-startup-message t)
(xterm-mouse-mode t)
(transient-mark-mode t)
(put 'downcase-region 'disabled nil)
(setq-default  ; file name in buffer
 frame-title-format
 (list '((buffer-file-name "Emacs: %f" 
	  (dired-directory 
	   dired-directory
	   (revert-buffer-function 
	    " %b"
	    ("%b - Dir:  " default-directory)))))))

;;; auk stuff
(setq make-backup-files nil)  ; keep the repo clean
(global-font-lock-mode t)     ; syntax highlight
(show-paren-mode t)           ; bracket match
(setq column-number-mode t)   ; know your widths
(setq                         ; enable auk mode
 auto-mode-alist         
 (append '(("\\.auk\\'" . awk-mode)) 
	 auto-mode-alist))

(setq ; control awk mode
 awk-mode-hook
 (function (lambda ()
	 (global-set-key "\C-f" 'auk-fill-paragraph)
	 ;(set (make-local-variable 'tab-width) 2)
	 ;(setq-default c-basic-offset 2)
	 (setq c-basic-offset 2)
	 (c-toggle-electric-state -1)
	 ;(setq indent-tabs-mode nil)
	 ;(setq c-indent-level 2)
	 ;(setq default-tab-width 2)
	 )))

; useful for markdown in awk
(defun auk-fill-paragraph ()
 (interactive)
 (save-excursion
	 (let (pt1 pt2 num)
		 (setq-default fill-column 52)
		 (forward-paragraph)
		 (setq pt1 (point))
		 (backward-paragraph)
		 (setq pt2 (point))
		 (set-mark pt1)
		 (fill-region pt1 pt2))))
